/*
 * @Author: robinbird && 1197737573@qq.com
 * @Date: 2023-10-17 11:06:37
 * @LastEditors: robinbird && 1197737573@qq.com
 * @LastEditTime: 2023-10-17 11:17:30
 * @FilePath: /ws_20376379/src/my_first_package/src/turtle_pub.cpp
 * @Description:
 *
 */
#include <ros/ros.h>
#include <geometry_msgs/Twist.h>


int main(int argc, char ** argv)
{
    ros::init(argc,argv,"turtle_vel_cmd_node");
    ros::NodeHandle nh;
    ros::Publisher vel_pub = nh.advertise<geometry_msgs::Twist>("/turtle1/cmd_vel",1000);

    ros::Rate rate(20);
    geometry_msgs::Twist cmd_vel;
    while (ros::ok())
    {
        cmd_vel.linear.x = 0.0;
        cmd_vel.linear.y = 2;
        cmd_vel.linear.z = 0.0;
        cmd_vel.angular.x = 0;
        cmd_vel.angular.y = 0;
        cmd_vel.angular.z = 1;
        vel_pub.publish(cmd_vel);
        ROS_INFO_ONCE("start pubing self-defined cmd");
        rate.sleep();
    }
    
    return 0;
}